<!-- 分页专用 -->

<input type="hidden" name="currentPage" value="1">
<div class="ui pagination menu">
	<a class="item" onclick="App.pagination(1)">首页</a>
<%
	var cPage = page.currentPage;
	var pSize = page.pageSize;
			    		
	if(cPage >= 5) {
		
		if((page.totalPage - cPage) > 5){ 
			for(var i = cPage - 4; i < cPage + 5; i++) {
%>
				<%if(i == cPage - 4) {%>
					<a class="item" onclick="App.pagination(${cPage-1})">上一页</a>
				<%}%>
							    				
				<%if(i == cPage) {%>
					<a class="active item" onclick="App.pagination(${i})">${i}</a>
				<%} else {%>
					<a class="item" onclick="App.pagination(${i})">${i}</a>
				<%}%>
									    		
				<%if(i == cPage + pSize - 5) {%>
					<a class="item" onclick="App.pagination(${cPage+1})">下一页</a>
				<%}%>
<%
			}
		} else {
			for(var i = cPage - 4; i <= page.totalPage; i++) {
%>
				<%if(i == cPage - 4) {%>
					<a class="item" onclick="App.pagination(${cPage-1})">上一页</a>
				<%}%>
							    				
				<%if(i == cPage) {%>
					<a class="active item" onclick="App.pagination(${i})">${i}</a>
				<%} else {%>
					<a class="item" onclick="App.pagination(${i})">${i}</a>
				<%}%>
									    		
				<%if(i == page.totalPage) {%>
					<a class="item" onclick="App.pagination(${cPage+1})">下一页</a>
				<%}%>
<%
			}
		}
	}else {
		for(var i= 1; i <=  10 ; i++){
%>
			<%
				if(i == 1) {
					if(cPage == 1){
			%>
						<a class="item" >上一页</a>
			<%
					} else {
			%>
						<a class="item" onclick="App.pagination(${cPage-1})">上一页</a>	
			<%
					}
				}
			%>
				
			<%if(i == cPage) {%>
				<a class="active item" onclick="App.pagination(${i})">${i}</a>
			<%} else {%>
				<a class="item" onclick="App.pagination(${i})">${i}</a>
			<%}%>
			<%if(i == 10) {%>
				<a class="item" onclick="App.pagination(${cPage+1})">下一页</a>
			<%}%>
<%
		}
	}
%>
	<a class="item" onclick="App.pagination(${page.totalPage})">尾页</a>
	<a class="item">当前第${page.currentPage}页/共${page.totalPage}页/${page.totalRecord}条记录</a>
		
	<select id="paseSize" name="pageSize" onchange="App.pagination(${page.currentPage})">
	    <option value="10" <%if(page.pageSize == 10) { print('selected');}%>>每页10条</option>
	    <option value="20" <%if(page.pageSize == 20) { print('selected');}%>>每页20条</option>
	    <option value="40" <%if(page.pageSize == 40) { print('selected');}%>>每页40条</option>
	</select>
		
</div>